Skip to content

Fix BetterChat anti-spam Network Protocol Error#6508

Open
yesidodo73 wants to merge 1 commit into
MeteorDevelopment:masterfrom
yesidodo73:fix/better-chat-anti-spam-refresh
Open

Fix BetterChat anti-spam Network Protocol Error#6508
yesidodo73 wants to merge 1 commit into
MeteorDevelopment:masterfrom
yesidodo73:fix/better-chat-anti-spam-refresh

Conversation

@yesidodo73

@yesidodo73 yesidodo73 commented Jul 7, 2026

Copy link
Copy Markdown

Type of change

  • Bug fix
  • New feature

Description

Fixed a BetterChat anti-spam issue that could cause a Network Protocol Error and disconnect when duplicate chat messages were merged while the chat line state was out of sync.

Description: Packet handling error

java.lang.IndexOutOfBoundsException: Index 11 out of bounds for length 10
    at java.base/java.util.ArrayList.remove(ArrayList.java:551)
    at meteordevelopment.meteorclient.systems.modules.misc.BetterChat.appendAntiSpam(BetterChat.java:374)
    at meteordevelopment.meteorclient.systems.modules.misc.BetterChat.onMessageReceive(BetterChat.java:286)

-- Incoming Packet --
Type: clientbound/minecraft:system_chat
Is Terminal: false
Is Skippable: true

BetterChat previously removed visible chat lines manually using cached line counts when anti-spam merged a duplicate message. If the cached line count no longer matched the actual trimmed chat list, it could try to remove an invalid index during system chat packet handling, causing Minecraft to show a Network Protocol Error and disconnect from the server.

After removing the duplicate message from chat history, BetterChat now refreshes the trimmed chat messages through Minecraft's normal refresh path instead of manually removing visible lines by index.

Related issues

None

How Has This Been Tested?

Tested by sending duplicate chat messages with BetterChat anti-spam enabled and confirming that duplicate messages are merged without causing a Network Protocol Error or disconnect.

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant